13 public class Gattaca_Tries
{
15 public static String letras
= "ACGT";
16 public static void main(String
[] args
) throws Exception
{
17 BufferedReader br
=new BufferedReader(new FileReader("gattaca.in"));
18 for (int T
=Integer
.parseInt(br
.readLine()),c
=0; c
<T
; c
++) {
19 String s
=br
.readLine();
20 int n
=s
.length(), rep
=0;
23 Node root
= new Node();
25 for (int i
=0; i
<n
; ++i
){
26 Node foot
= root
; //Tells me where i'm standing.
28 for (int j
=i
; j
<n
; ++j
){
29 //System.out.println("i " + i + " j " + j);
31 so_far
= s
.substring(i
, j
);
32 int v
= letras
.indexOf(s
.charAt(j
));
33 if (foot
.sons
[v
] == null) foot
.sons
[v
] = new Node();
36 if (t
> 1 && (so_far
.length() > ans
.length() || (so_far
.length() == ans
.length() && so_far
.compareTo(ans
) < 0))){
42 System
.out
.println(ans
.length() == 0 ?
"No repetitions found!":(ans
+ " " + rep
));